package com.greenline.push.service.core.item;

import java.util.Map;

import com.greenline.push.core.enums.AppPacketSource;

/**
 * 
 * @author weirui.shenwr
 * @date 2014-10-13
 * @version V1.0
 */
public class AppPacket extends Packet {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private Long appTemplateId;// app_templaate 的id
    private String appId;
    private String deviceToken;
    // 外部推送渠道的模板ID，微信的模板id,echat 的通知类型，email的模板id
    private String extTemplId;

    // 不支持模板的直接推送内容
    private String context;

    private Map<String, String> extParam;
    private Long dbRetryId;// msg_retry的id
    private String extTemplType;// mail
    private AppPacketSource source;// default来自 msg_retry, full 来自
                                   // msg_retry_full
    private transient String userids;// 列表发送需要该属性

    public String getUserids() {
        return userids;
    }

    public void setUserids(String userids) {
        this.userids = userids;
    }

    public AppPacketSource getSource() {
        return source;
    }

    public void setSource(AppPacketSource source) {
        this.source = source;
    }

    public String getExtTemplType() {
        return extTemplType;
    }

    public Long getAppTemplateId() {
        return appTemplateId;
    }

    public void setAppTemplateId(Long appTemplateId) {
        this.appTemplateId = appTemplateId;
    }

    public void setExtTemplType(String extTemplType) {
        this.extTemplType = extTemplType;
    }

    public Long getDbRetryId() {
        return dbRetryId;
    }

    public void setDbRetryId(Long dbRetryId) {
        this.dbRetryId = dbRetryId;
    }

    public String getAppId() {
        return appId;
    }

    public AppPacket() {

    }

    public String getExtTemplId() {
        return extTemplId;
    }

    public void setExtTemplId(String extTemplId) {
        this.extTemplId = extTemplId;
    }

    public AppPacket(Packet p) {
        setDbMsgId(p.getDbMsgId());
        setPriority(p.getPriority());
        setRecvUserId(p.getRecvUserId());
        setSendingTime(p.getSendingTime());
        setTemplateId(p.getTemplateId());
        setType(p.getType());
        setDomainId(p.getDomainId());
        setMessageId(p.getMessageId());
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getDeviceToken() {
        return deviceToken;
    }

    public void setDeviceToken(String deviceToken) {
        this.deviceToken = deviceToken;
    }

    public Map<String, String> getExtParam() {
        return extParam;
    }

    public void setExtParam(Map<String, String> extParam) {
        this.extParam = extParam;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }
}
